<?php 
	session_start();
	include_once('./controller/GeneralController.php');
	include_once('./helper/FormHelper.php');
	include_once('./controller/CommunityController.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml" dir="ltr">

<head>	
	<title>TicToc - Product</title>
	
	<?php include_once('./templates/HeadReferences.php'); ?>
	
	<script language="JavaScript" type="text/javascript">
		$(document).ready(function(){
			var newTopicValidator = $('#new-topic-form').validate(
			{
				rules: 
				{
					txtNewTopicName: 
					{
						required: true
					}
				},
				highlight: function(element) {
					$(element).closest('.form-group').removeClass('success').addClass('error');
				},
				success: function(element) {
					element.text('OK!').addClass('valid').closest('.form-group').removeClass('error').addClass('success');
				}
			});
			
			var newPostValidator = $('#new-post-form').validate(
			{
				rules: 
				{
					txtNewPostTitle: 
					{
						required: true
					},
					txtNewPostBody: 
					{
						required: true
					}
				},
				highlight: function(element) {
					$(element).closest('.form-group').removeClass('success').addClass('error');
				},
				success: function(element) {
					element.text('OK!').addClass('valid').closest('.form-group').removeClass('error').addClass('success');
				}
			});
			
			$('.smiley-container').emoticonize({
				//delay: 800,
				//animate: false,
				//exclude: 'pre, code, .no-emoticons'
			});
		}); 
	</script>
	<style type="text/css">
		.span4 {
			width: 300px !important;
		}
		
		.span5 {
			width: 380px !important;
		}
		
		.span6 {
			width: 460px !important;
		}
		
		.span7 {
			width: 540px !important;
		}
	
		.nav > li > a {
		  padding: 5px 10px;
		}
		
		.navbar-collapse{
			border-color: #e7e7e7;
			background-color: #428bca;
			
		}
		
		.navbar-collapse a{color: white !important;}
		
		.navbar-collapse li ul li a{color: black !important;}
		
		
		#txtNewTopicDescription, #txtUpdateTopicDescription,#txtNewPostBody{height:150px}
		
		.topic-row{height:40px;}
		
		.navbar{min-height:30px;}
		.topic-name-col{width:400px; font-size:15px; font-weight: 500;}
		.topic-post-count-col {width:100px;}
		.topic-control-col{width:100px; text-align:right;}
		
		.topic-control-edit-button{margin-right:10px;}
		.topic-header{margin-bottom:80px;}
		.new-post-container{margin-top:80px;}
		
		.post-user-info{width:175px;padding:10px;border-right:solid 1px #e2e1ea;}
		.post-body-container{padding:10px;min-width:500px;}
		.post-username-container{font-size:16px;}
		.post-body-seperator{margin-top:5px; margin-bottom:15px;}
		.post-panel .panel-body{padding-top:0px;padding-bottom:0px;}
		
		.post-control-remove-button{margin-right:10px;}
		
		.user-img-container{height:80px;width:70px;}
		.post-user-img{width:80px;height:80px;}
		
		.white, .white a { color: #fff;}
	</style>
</head>
<body>

	<?php include_once('./templates/PopupBox.php'); ?>
<!-- Wrapper -->
	<div id="wrapper">
		<!-- Header -->
		<div id="top">
			<!-- Shell -->
				<div class="shell">
					<?php include_once('./templates/TopNav.php'); ?>
				</div>
			<!-- End Shell -->
		</div>
		<!-- End Top -->
		<!-- Main -->
		<div id="main">
			<!-- Shell -->
			<div class="shell">
				<!-- Header -->
					<?php include_once('./templates/Header.php'); ?>
				<!-- End Header -->

				<div class="shell">
						
					<?php 
						if(isLoggedIn())
						{
							include_once('./templates/CommunityNavBar.php'); 
						}
					?>
				</div>
				
				<!-- Form -->
					<?php 
						getContent();
					?>
				<!-- End Form -->
	
			</div>	
		</div>	
		<!-- Footer -->
			<?php include_once('./templates/Footer.php'); ?>
		<!-- End Footer -->
	</body>
</html>
